package com.zf.yichat.api.dto.request;

import com.zf.yichat.utils.YiChatMsgCode;
import org.hibernate.validator.internal.util.Contracts;

import java.math.BigDecimal;

/**
 * 一句话描述功能
 *
 * @author fengsong
 * @date create in 15:04 2019/6/11 2019
 */
public class PacketSaleCreateRequest extends FsRequest {

    //份数
    private Integer num;
    //类型 0 广告红包（直接到账） 1 商品红包（需要审核），不传默认0
    private Integer type;

    //金额
    private BigDecimal money;

    //红包内容
    private String content;
    //标题
    private String name;

    //照片
    private String imgs;

    private String linkUrl;

    private Integer linkUrlStatus; //外链页面展示状态 0不展示 1展示

    private Integer contactStatus;//0不可联系 1可以联系

    private String video; //视频

    private String thumbnail;//视频缩略图

    private BigDecimal longitude;//经度

    private BigDecimal latitude;//纬度

    private String location;//位置名称

    private Integer limitDistance;//公里数

    private String question;//问题

    private String answer;//答案

    private String tip;//提示

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getQuestion() {
        return question;
    }

    public void setQuestion(String question) {
        this.question = question;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public String getTip() {
        return tip;
    }

    public void setTip(String tip) {
        this.tip = tip;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Integer getLimitDistance() {
        return limitDistance;
    }

    public void setLimitDistance(Integer limitDistance) {
        this.limitDistance = limitDistance;
    }

    public Integer getLinkUrlStatus() {
        return linkUrlStatus;
    }

    public void setLinkUrlStatus(Integer linkUrlStatus) {
        this.linkUrlStatus = linkUrlStatus;
    }

    public String getThumbnail() {
        return thumbnail;
    }

    public void setThumbnail(String thumbnail) {
        this.thumbnail = thumbnail;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public String getLinkUrl() {
        return linkUrl;
    }

    public void setLinkUrl(String linkUrl) {
        this.linkUrl = linkUrl;
    }

    public Integer getContactStatus() {
        return contactStatus;
    }

    public void setContactStatus(Integer contactStatus) {
        this.contactStatus = contactStatus;
    }

    public String getVideo() {
        return video;
    }

    public void setVideo(String video) {
        this.video = video;
    }

    @Override
    public void valid() {

        Contracts.assertNotNull(num, YiChatMsgCode.SYSTEM_PARAM_ERROR.msg());
        Contracts.assertNotNull(num > 0, YiChatMsgCode.SYSTEM_PARAM_ERROR.msg());
        Contracts.assertNotNull(money, YiChatMsgCode.SYSTEM_PARAM_ERROR.msg());
        Contracts.assertTrue(money.compareTo(BigDecimal.ZERO) > 0, YiChatMsgCode.SYSTEM_PARAM_ERROR.msg());
        Contracts.assertNotNull(content, YiChatMsgCode.SYSTEM_PARAM_ERROR.msg());


    }
}
